package com.demo.controller;

import com.demo.common.model.R;
import com.demo.entity.DicValue;
import com.demo.service.DicValueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/dic")
public class DicController {
    @Autowired
    private DicValueService dicValueService;
    /**
     * 根据字典劣效查询字典列表
     */
    @GetMapping("/value/list")
    public R<List<DicValue>> loadDicValueList(@RequestParam String typeCode){
        List<DicValue> list = dicValueService.queryDicValueListByTypeCode(typeCode);
        return R.OK(list);
    }
}
